import { createRouter, createWebHistory } from 'vue-router'

import HomeView from '../views/HomeView/HomeView.vue'
import ConcernView from '../views/ConcernView/ConcernView.vue'
import FairView from '../views/FairView/FairView.vue'
import UserView from '../views/UserView/UserView.vue'
import ExifView from '../views/ExifView/ExifView.vue'


const routes = [
  // 自动重定向
  {
    path: '',
    redirect: "/home"
  },
  {
    path: '/',
    redirect: '/home'  //默认显示
  },
  {
    path: '/home',
    name: 'home',
    component: HomeView,
    children: [
      {
        path: 'search',
        name: 'search',
        component: () => import("../views/HomeView/HomeSearchView.vue")
      },
      {
        path: 'video-details',
        name: 'video-details',
        component: () => import("../views/HomeView/VideoDetails.vue")
      },
      {
        path: 'item',
        name: 'item',
        component: () => import("../views/HomeView/HomeItem.vue")
      },
      {
        path: 'granary-nav-item',
        name: 'granary-nav-item',
        component: () => import("../views/HomeView/GranaryNavItem.vue")
      }
    ]
  },
  {
    path: '/concern',
    name: 'concern',
    component: ConcernView,
  },
  {
    path: '/exif',
    name: 'exif',
    component: ExifView,
  },
  {
    path: '/fair',
    name: 'fair',
    component: FairView,
  },
  {
    path: '/user',
    name: 'user',
    component: UserView,
    children: [
      {
        path: 'my-love',
        name: 'my-love',
        component: () => import("../views/UserView/MyLove.vue")
      },
      {
        path: 'my-Collection',
        name: 'my-Collection',
        component: () => import("../views/UserView/MyCollection.vue")
      },
      {
        path: 'my-footsteps',
        name: 'my-footsteps',
        component: () => import("../views/UserView/MyFootsteps.vue")
      }
    ]
  },
  // {
  //   path: '/login',
  //   name: 'login',
  //   component: () => import("../views/UserView/LoginView.vue")
  // },
  // {
  //   path: '/longin-details',
  //   name: 'longin-details',
  //   component: () => import("../views/UserView/LonginDetails.vue"),
  // }
]




const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
})

export default router
